<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
  <title>JLogalizer-Command window</title>

  
  
  <script type="text/javascript" src="jquery.js"></script>
  
  <script type="text/javascript">
function executeCmd(){

	var commandBoxVal = $("#commandBox").val();
	var random = Math.floor(Math.random()*10101010101)
	$.ajax({
	type: "GET",
	url: "process.htm?" + random,
	data: "commandBox="+commandBoxVal,
	success: servletCallResult
	});
	
	
}

function servletCallResult (result){
		alert ('command executed successfully')
		refreshFile();
}

function refreshFile (){
	var random = Math.floor(Math.random()*10101010101)
	$.ajax({
	type: "GET",
	url: "display.htm?" + random,
	success: refreshCallResult
	});
}

function refreshCallResult (result){
	$("#resultTextArea").html(result)
}


function populateCommand (cmd){
	$("#commandBox").val(cmd);
}

  </script>
</head><body>
<h3>JLogalizerWeb - Command window</h3>

<br>

<small>for internal purposes only<br>
<br>
</small><label>Enter command :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="commandBox" id="commandBox" value="ls -ltr" size="120">&nbsp;&nbsp;&nbsp;&nbsp;
<input accesskey="E" value="Execute" name="execBtn" onclick="executeCmd();" type="button"><br>

<br>

<br>

<input accesskey="E" value="Refresh" name="refreshBtn" onclick="refreshFile();" type="button"><br>

<br>

<table style="text-align: left; width: 1410px; height: 27px;" border="1" cellpadding="2" cellspacing="2">

  <tbody>
    <tr>
      <td style="vertical-align: top;"><br>
      <textarea id="resultTextArea" rows="100" cols="120"></textarea><br>
      </td>
      <td style="vertical-align: top; height: 1556px; width: 292px"><br>
      <ul>
      	<li><a href="#" onclick="populateCommand('hadoop fs -ls input')">ls input</a></li>
      	<li><a href="#" onclick="populateCommand('hadoop fs -copyFromLocal /home/ec2-user/input/* input/')">copy to dfs</a></li>
        <li><a href="#" onclick="populateCommand('hadoop fs -ls output')">ls output</a></li>
        <li><a href="#" onclick="populateCommand('export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/home/ec2-user/mapred/mapreduce.properties:')">Set HADOOP_CP</a></li>
        <li><a href="#" onclick="populateCommand('hadoop jar /home/ec2-user/mapred/JLogalizerMapRed.jar -D log_file_type=APACHE_ACCESS_LOG -D position_in_log_file=1 IPMapReduce /user/ec2-user/input /user/ec2-user/output -libjars /home/ec2-user/mapred/JLogalizerMapRed.jar >> /tmp/processoutput.log')">Execute IP Mapred</a></li>
        <li><a href="#" onclick="populateCommand('hadoop fs -rmr output')">remove output dir</a></li>
        
        
        
      </ul>
      </td>
    </tr>
  </tbody>
</table>

<br>

<br>

</body></html>